function giveMeAFunction() {  var counter = 0;  return function() {      counter++;      return counter;    };}
var myCounter = giveMeAFunction();
export default {
    namespaced:true,
    actions:{
        add_cart(context,row){
            context.commit('ADD_CART',row)
        },
        delete_in_cart(context,row){
            context.commit('DELETE_IN_CART',row)
        },
    },
    mutations:{
        ADD_CART(state,row){
            // state.goods.push(row)
            var good = {
                name:row.name,
                price:row.price,
                number:1,
                uid:row.id,
                id:myCounter(),
                limit:99
                }
            state.goods.push(good)
        },
        
    },
    state:{
        goods:[
            
        ]
    }
}

